﻿@model Model.CompanyModel

@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>AddCompany</title>
    <script src="~/Scripts/jquery-1.8.2.min.js"></script>
    <script src="~/Scripts/jquery.validate.min.js"></script>
    <script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>
    <link rel="stylesheet" media="screen" href="http://fonts.useso.com/css?family=Open+Sans:300,400,700">
    <link href="~/assets/css/bootstrap.min.css" rel="stylesheet" />
    <link href="~/assets/css/font-awesome.min.css" rel="stylesheet" />
    <!-- Custom styles for our template -->
    <link href="~/assets/css/bootstrap-theme.css" rel="stylesheet" />
    <link href="~/assets/css/da-slider.css" rel="stylesheet" />
    <link href="~/assets/css/style.css" rel="stylesheet" />
    <script>
    $(function () {

        $("input").keyup(function () {

            if ($("#txtname").val() == "") {
                $("#spname").text("公司名称不能为空")
                $("#spname1").text("")
            }
            else {
                $("#spname").text("")
                $("#spname1").text("√")
            }

            if ($("#txtcremark").val() == "") {
                $("#spRemark").text("公司介绍不能为空")
                $("#spRemark1").text("")
            }
            else {
                $("#spRemark").text("")
                $("#spRemark1").text("√")
            }


            if ($("#txtsl").val() == "") {
                $("#spCompanyImg").text("公司实力不能为空")
                $("#spCompanyImg1").text("")
            }
            else {
                $("#spCompanyImg").text("")
                $("#spCompanyImg1").text("√")
            }
            if ($("#txtcremark2").val() == "") {
                $("#spcrk").text("公司简介不能为空")
                $("#spcrk2").text("")
            }
            else {
                $("#spcrk").text("")
                $("#spcrk2").text("√")
            }

        })
        $("#sub").click(function () {

            if ($("#txtname").val() == "") {
                $("#spname").text("公司名称不能为空")
                return false;
            }
            if ($("#txtcremark").val() == "") {
                $("#spRemark").text("公司介绍不能为空")
                return false;
            }
            if ($("#txtsl").val() == "") {
                $("#spCompanyImg").text("公司实力不能为空")
                return false;
            }
            if ($("#txtcremark2").val() == "") {
                $("#spcrk").text("公司简介不能为空")
                return false;
            }
        })
        $("#back").click(function () {

            $("#spname1").text("")
            $("#spRemark1").text("")
            $("#spCompanyImg1").text("")
            $("#spcrk2").text("")
        })

    })
    </script>

</head>
<body>
    <div class="navbar navbar-inverse">
        <div class="container">
            <div class="navbar-header">
                <!-- Button for smallest screens -->
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button>
                <a class="navbar-brand" href="/Home/Index">

                    <img src="~/assets/images/favicon.png" />面试题库
                </a>
            </div>
            <div class="navbar-collapse collapse">
                <ul class="nav navbar-nav pull-right" style="margin-right:600px">
                    <li class="active"><a href="/Home/Addcompany">添加公司</a></li>
                    <li></li>
                    <li class="active"><a href="/Text/Show">导入面试题</a></li>
                </ul>
            </div>
            <!--/.nav-collapse -->
        </div>
    </div>
    <div style="padding-left:450px;padding-top:10px;">
        @using (Html.BeginForm("AddCompany", "Home", FormMethod.Post, new { enctype = "multipart/form-data" }))
        {
          


            <div class="editor-label">
                <h3>公司名称</h3>
            </div>
            <div class="editor-field">
              
                <input id="txtname" type="text" name="CompanyName" />
                <span id="spname" style="color:red"></span> <span id="spname1" style="color:blue"></span>
            </div>

            <div class="editor-label">
                <h3>公司LOGO</h3>
            </div>
            <div class="editor-field">
                <input id="File1" type="file" name="file" />
            </div>

            <div class="editor-label">
                <h3>公司介绍</h3>
            </div>
            <div class="editor-field">
              
                <input id="txtcremark" type="text" name="CompanyRemark" />
                <span id="spRemark" style="color:red"></span> <span id="spRemark1" style="color:blue"></span>
            </div>

            <div class="editor-label">
               <h3>公司实力</h3> 
            </div>
            <div class="editor-field">
              
                <input id="txtsl" type="text" name="CompanyImg" />
                <span id="spCompanyImg" style="color:red"></span> <span id="spCompanyImg1" style="color:blue"></span>
            </div>

            <div class="editor-label">
               <h3>公司简介</h3> 
            </div>
            <div class="editor-field">
              
                <input id="txtcremark2" type="text" name="CompanyRemark2" />
                <span id="spcrk" style="color:red"></span> <span id="spcrk2" style="color:blue"></span>
            </div>

            <p style="padding-top:20px;">
                <button type="submit" class="btn btn-primary" id="sub">添加</button>
                <button type="reset" class="btn btn-default" id="back">取消</button>
            </p>

        }
    </div>
    <script src="~/assets/js/modernizr-latest.js"></script>
    <script src="http://apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>
    <script src="http://apps.bdimg.com/libs/bootstrap/3.3.0/js/bootstrap.min.js"></script>

    <script src="~/assets/js/jquery.cslider.js"></script>

    <script src="~/assets/js/custom.js"></script>
</body>
</html>
